package cn.wusifx.zabbix.request.builder.user;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/user/create
 */
public class UserCreateRequestBuilder extends CreateRequestBuilder {
    private String alias;
    private String passwd;
    private List<Map<String,Object>> usrgrps;
    public UserCreateRequestBuilder(String auth) {
        super("user.create", auth);
    }

    public UserCreateRequestBuilder(Long id, String auth) {
        super("user.create", id, auth);
    }

    public String getAlias() {
        return alias;
    }

    public UserCreateRequestBuilder setAlias(String alias) {
        this.alias = alias;
        return this;
    }

    public String getPasswd() {
        return passwd;
    }

    public UserCreateRequestBuilder setPasswd(String passwd) {
        this.passwd = passwd;
        return this;
    }

    public List<Map<String, Object>> getUsrgrps() {
        return usrgrps;
    }

    public UserCreateRequestBuilder setUsrgrps(List<Map<String, Object>> usrgrps) {
        this.usrgrps = usrgrps;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("alias",alias);
        baseRequest.getParams().put("passwd",passwd);
        baseRequest.getParams().put("usrgrps",usrgrps);
        return baseRequest;
    }
}
